<?php
// ini_set('display_errors',1);            //错误信息  
// ini_set('display_startup_errors',1);    //php启动错误信息  
// error_reporting(-1); 
date_default_timezone_set("PRC"); 
require_once('config.php');
function check($str){
if(strstr($str,"'")||strstr($str,";")||strstr($str,"union")||strstr($str,"‘")){
return "ok";
}else{
return "no";
}}

$conn = mysqli_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname);

$data=json_decode($_POST["Data"], true);

$user_name=$data["name"];
$userid="cloud_".$data["userid"];
$maxhostsize=50*1024*1024;
if(check($userid)=="ok"||check($step)=="ok"){echo "1|";exit;}
$mquery="select * from ph_admin where admin='".$userid."'";
$mresult=mysqli_query($conn,$mquery);
if(mysqli_num_rows($mresult)<1){
  $sql = "INSERT INTO ph_admin(admin,adminpass,thetype,parent,maxhostsize)VALUES('".$userid."','".$userid."','员工','gouadmin','".$maxhostsize."')";
  mysqli_query($conn,$sql);
  echo "7";
}

?>